import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/product_entity.dart';

ProductEntity $ProductEntityFromJson(Map<String, dynamic> json) {
	final ProductEntity productEntity = ProductEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		productEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		productEntity.msg = msg;
	}
	final List<ProductData>? data = jsonConvert.convertListNotNull<ProductData>(json['data']);
	if (data != null) {
		productEntity.data = data;
	}
	return productEntity;
}

Map<String, dynamic> $ProductEntityToJson(ProductEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	return data;
}

ProductData $ProductDataFromJson(Map<String, dynamic> json) {
	final ProductData productData = ProductData();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		productData.id = id;
	}
	final String? mainImg = jsonConvert.convert<String>(json['main_img']);
	if (mainImg != null) {
		productData.mainImg = mainImg;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		productData.name = name;
	}
	final String? price = jsonConvert.convert<String>(json['price']);
	if (price != null) {
		productData.price = price;
	}
	final String? sort = jsonConvert.convert<String>(json['sort']);
	if (sort != null) {
		productData.sort = sort;
	}
	final String? salesNum = jsonConvert.convert<String>(json['sales_num']);
	if (salesNum != null) {
		productData.salesNum = salesNum;
	}
	final String? areaId = jsonConvert.convert<String>(json['area_id']);
	if (areaId != null) {
		productData.areaId = areaId;
	}
	final String? integral = jsonConvert.convert<String>(json['integral']);
	if (integral != null) {
		productData.integral = integral;
	}
	final String? storeId = jsonConvert.convert<String>(json['store_id']);
	if (storeId != null) {
		productData.storeId = storeId;
	}
	final ProductDataStore? store = jsonConvert.convert<ProductDataStore>(json['store']);
	if (store != null) {
		productData.store = store;
	}
	final String? func = jsonConvert.convert<String>(json['func']);
	if (func != null) {
		productData.func = func;
	}
	final String? allowPayStr = jsonConvert.convert<String>(json['allow_pay_str']);
	if (allowPayStr != null) {
		productData.allowPayStr = allowPayStr;
	}
	final String? money = jsonConvert.convert<String>(json['money']);
	if (money != null) {
		productData.money = money;
	}
	final String? money1 = jsonConvert.convert<String>(json['money1']);
	if (money1 != null) {
		productData.money1 = money1;
	}
	final String? company = jsonConvert.convert<String>(json['company']);
	if (company != null) {
		productData.company = company;
	}
	final String? company1 = jsonConvert.convert<String>(json['company1']);
	if (company1 != null) {
		productData.company1 = company1;
	}
	return productData;
}

Map<String, dynamic> $ProductDataToJson(ProductData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['main_img'] = entity.mainImg;
	data['name'] = entity.name;
	data['price'] = entity.price;
	data['sort'] = entity.sort;
	data['sales_num'] = entity.salesNum;
	data['area_id'] = entity.areaId;
	data['integral'] = entity.integral;
	data['store_id'] = entity.storeId;
	data['store'] = entity.store.toJson();
	data['func'] = entity.func;
	data['allow_pay_str'] = entity.allowPayStr;
	data['money'] = entity.money;
	data['money1'] = entity.money1;
	data['company'] = entity.company;
	data['company1'] = entity.company1;
	return data;
}

ProductDataStore $ProductDataStoreFromJson(Map<String, dynamic> json) {
	final ProductDataStore productDataStore = ProductDataStore();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		productDataStore.id = id;
	}
	final String? name = jsonConvert.convert<String>(json['name']);
	if (name != null) {
		productDataStore.name = name;
	}
	final String? logo = jsonConvert.convert<String>(json['logo']);
	if (logo != null) {
		productDataStore.logo = logo;
	}
	return productDataStore;
}

Map<String, dynamic> $ProductDataStoreToJson(ProductDataStore entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['name'] = entity.name;
	data['logo'] = entity.logo;
	return data;
}